package com.lam.mall.entity;

import java.util.Date;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import javax.validation.constraints.Size;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.lam.common.base.domain.BaseEntity;
import com.lam.common.components.dict.annotation.Dict;
import com.lam.common.utils.DateUtil;
import com.lam.common.validate.annotation.DictCheck;
import com.lam.common.validate.annotation.DictValid;
import com.lam.common.validate.group.Add;

/**
 * 轮播图设置对象 mall_index_img
 * 
 * @author admin
 * @date 2023-04-20
 */
@DictCheck
@TableName("mall_index_img")
public class IndexImg implements BaseEntity{

    /** 主键 */
    @Null(groups = Add.class, message="id必须为空")
    @TableId(type = IdType.AUTO)
    private String id;
    
    /** 店铺ID */
    private String shopId;

    /** 标题 */
    @NotBlank(message = "标题不能为空")
    @Size(max = 200, message = "标题长度不能超过200个字符")
    private String title;

    /** 描述 */
    @NotBlank(message = "描述不能为空")
    @Size(max = 200, message = "描述长度不能超过200个字符")
    private String descs;

    /** 图片 */
    @Size(max = 200, message = "图片长度不能超过200个字符")
    private String imgUrl;

    /** 链接 */
    @Size(max = 300, message = "链接长度不能超过300个字符")
    private String link;

    /** 关联商品 */
    private String relationProd;

    /** 类型(0-无, 1-商品, 2-链接) */
    @NotNull(message = "类型不能为空")
    @DictValid(message = "无效的类型")
    @Dict(dictCode = "index_img_type")
    private Integer type;

    /** 状态 */
    @NotNull(message = "状态不能为空")
    @DictValid(message = "无效的状态")
    @Dict(dictCode = "status_type")
    private Integer status;

    /** 顺序 */
    private Integer sortNo;

    /** 创建人 */
    private String createBy;

    /** 创建时间 */
    @JsonFormat(pattern = DateUtil.PATTERN_DEFAULT)
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /** 更新人 */
    private String updateBy;

    /** 更新时间 */
    @JsonFormat(pattern = DateUtil.PATTERN_DEFAULT)
    @TableField(fill = FieldFill.UPDATE)
    private Date updateTime;

    /** 备注 */
    @Size(max = 255, message = "备注长度不能超过255个字符")
    private String remark;
    
    /**
     * 商品图片
     */
    @TableField(exist = false)
    private String pic;

    /**
     * 商品名称
     */
    @TableField(exist = false)
    private String prodName;

    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    } 

    public void setShopId(String shopId) {
        this.shopId = shopId;
    }

    public String getShopId() {
        return shopId;
    }    
    
    public void setTitle(String title) {
        this.title = title;
    }

    public String getTitle() {
        return title;
    }    
    
    public void setDescs(String descs) {
        this.descs = descs;
    }

    public String getDescs() {
        return descs;
    }    
    
    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public String getImgUrl() {
        return imgUrl;
    }    
    
    public void setLink(String link) {
        this.link = link;
    }

    public String getLink() {
        return link;
    }    
    
    public void setRelationProd(String relationProd) {
        this.relationProd = relationProd;
    }

    public String getRelationProd() {
        return relationProd;
    }    
    
    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getType() {
        return type;
    }    
    
    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getStatus() {
        return status;
    }    
    
    public void setSortNo(Integer sortNo) {
        this.sortNo = sortNo;
    }

    public Integer getSortNo() {
        return sortNo;
    }    
    
    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public String getCreateBy() {
        return createBy;
    }    
    
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getCreateTime() {
        return createTime;
    }    
    
    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public String getUpdateBy() {
        return updateBy;
    }    
    
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }    
    
    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getRemark() {
        return remark;
    }

	public String getPic() {
		return pic;
	}

	public void setPic(String pic) {
		this.pic = pic;
	}

	public String getProdName() {
		return prodName;
	}

	public void setProdName(String prodName) {
		this.prodName = prodName;
	}    
    

}
